package exp2.TDD;

/**
 * Created by mc on 2017/4/18.
 */
import exp2.*;
import org.junit.Test;
import junit.framework.TestCase;
public class MyUtilTest extends TestCase {
    @Test
    public void testNormal() {
        if (exp2.MyUtil.percentage2fivegrade(0) != "不及格")
            System.out.println("test failed 1!");
        else if (exp2.MyUtil.percentage2fivegrade(60) != "及格")
            System.out.println("test failed 2!");
        else if (exp2.MyUtil.percentage2fivegrade(70) != "中等")
            System.out.println("test failed 3!");
        else if (exp2.MyUtil.percentage2fivegrade(80) != "良好")
            System.out.println("test failed 4!");
        else if (exp2.MyUtil.percentage2fivegrade(90) != "优秀")
            System.out.println("test failed 5!");
        else if (exp2.MyUtil.percentage2fivegrade(100) != "优秀")
            System.out.println("test failed 6!");
        else
            System.out.println("test passed!");
    }
    @Test
    public void testNormal1() {
        if (exp2.MyUtil.percentage2fivegrade(-10) != "错误")
            System.out.println("test failed 1!");
        else if (exp2.MyUtil.percentage2fivegrade(115) != "错误")
            System.out.println("test failed 2!");
        else
            System.out.println("test passed!");
    }
    @Test
    public void testNormal2() {
        if (exp2.MyUtil.percentage2fivegrade(55) != "不及格")
            System.out.println("test failed!");
        else if (exp2.MyUtil.percentage2fivegrade(65) != "及格")
            System.out.println("test failed!");
        else if (exp2.MyUtil.percentage2fivegrade(75) != "中等")
            System.out.println("test failed!");
        else if (exp2.MyUtil.percentage2fivegrade(85) != "良好")
            System.out.println("test failed!");
        else if (exp2.MyUtil.percentage2fivegrade(95) != "优秀")
            System.out.println("test failed!");
        else
            System.out.println("test passed!");

    }
}